# Maintainer: Stéphane Gaudreault <stephane@archlinux.org>
# Contributor: Sylvain HENRY <hsyl20@yahoo.fr>

pkgname=opencl-headers
pkgver=2021.04.29
pkgrel=1
epoch=2
pkgdesc='OpenCL (Open Computing Language) header files'
arch=('any')
url='https://www.khronos.org/registry/cl/'
license=('custom')
source=("${pkgname}-${pkgver}.tar.gz::https://github.com/KhronosGroup/OpenCL-Headers/archive/v${pkgver}.tar.gz")
sha256sums=('477e2b26125d99a9b2f20c68262f27ca3f3ca7899593a8af2b7fe077bdce18d1')
optdepends=('opencl-clhpp: C++ support')

package() {
  cd "${srcdir}"/OpenCL-Headers*/CL

  install -dm755 "${pkgdir}"/usr/include/CL

  for h in *.h; do
    install -m 644 ${h} "${pkgdir}"/usr/include/CL/
  done

  # remove useless headers
  rm "${pkgdir}"/usr/include/CL/{cl_d3d,cl_dx9}*.h

  install -D -m644 ../LICENSE "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
}
